package pi.client.gui;

import java.awt.Dimension;
import java.awt.Toolkit;

import javax.swing.JFrame;

import pi.client.gui.MyMainPanel;

@SuppressWarnings("serial")
public class MyFrame extends JFrame{
	public MyFrame(MyMainPanel mainPanel){
		super();
		
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setVisible(true);
		setResizable(false);
		
		setIconImage(mainPanel.program.icon);
		
		getContentPane().add(mainPanel);
		pack();

		Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
		Dimension frameSize = getSize();
		setLocation(screenSize.width/2 - frameSize.width/2, screenSize.height/2 - frameSize.height/2);
		pack();
	}
}
